import { globalShortcut, BrowserWindow } from 'electron';
import _ from 'lodash';

export default function() {
    globalShortcut.register('Escape', () => {
        let activeWindow = BrowserWindow.getFocusedWindow();
        if (_.isNull(activeWindow)) return;
        activeWindow.webContents.send('toggle-menu');
    });

    globalShortcut.register('CommandOrControl+L', () => {
        let activeWindow = BrowserWindow.getFocusedWindow();
        if (_.isNull(activeWindow)) return;
        activeWindow.webContents.send('lockdown');
    });
}
